
const express = require('express');
const router = new express.Router();

/**
 * @param {Object} options
 * @param {} options.dealerId 总代Id
 * @param {} options.status 价格条款  1-包装完成  2-发票生成  -1-作废
 * @param {} options.containerNo 柜图号
 * @param {} options.partSaleOrderCode 备件销售订单编号
 * @param {} options.priceTerms 价格条款  1-FOB  2-CFR  3-CIF  4-FCA  5-CPT  6-CIP  7-EXW
 * @param {} options.paymentType 付款方式  1-T/T  2-L/C  3-Credit
 * @param {} options.shipmentType 运输方式  1-海运  2-空运  3-快递
 * @param {} options.beginSubmitTime 提交时间-开始时间
 * @param {} options.endSubmitTime 提交时间-结束时间
 * @param {} options.pageSize 每页数据量
 * @param {} options.pageIndex 指定页
 * @param {} options.sortField 排序字段
 * @param {} options.isDesc 倒序排列
 * @throws {Error}
 * @return {Promise}
 */
router.get('/forPartInvoiceManage', async(req, res, next) => {
    const options = {
        dealerId: req.query.dealerId,
        status: req.query.status,
        containerNo: req.query.containerNo,
        partSaleOrderCode: req.query.partSaleOrderCode,
        priceTerms: req.query.priceTerms,
        paymentType: req.query.paymentType,
        shipmentType: req.query.shipmentType,
        beginSubmitTime: req.query.beginSubmitTime,
        endSubmitTime: req.query.endSubmitTime,
        pageSize: req.query.pageSize,
        pageIndex: req.query.pageIndex,
        sortField: req.query.sortField,
        isDesc: req.query.isDesc
    };
    const data = {
        message: 'message',
        payload: {
            content: [
                {
                    rowVersion: 'rowVersion',
                    id: 'id785',
                    code: 'code786',
                    packingType: 1,
                    container: 'container',
                    length: 1,
                    width: 1,
                    height: 1,
                    volume: 1,
                    netWeight: 7,
                    grossWeight: 8,
                    containerNo: 'containerNo',
                    remark: 'remark',
                    pickingListCodes: 'pickingListCodes',
                    palletCodes: 'palletCodes1,palletCodes2',
                    paymentTypes: 'paymentTypes',
                    shipmentTypes: 'shipmentTypes',
                    paymentType: 'paymentType',
                    priceTerms: 'priceTerms',
                    details: [
                        {
                            id: 'id687',
                            palletCode: 'palletCode688',
                            partSaleOrderCode: 'partSaleOrderCode688',
                            partCode: 'partCode689',
                            partName: 'partName690',
                            quantity: 1,
                            price: 1,
                            pricingDate: '2019-09-11T07:50:22Z',
                            totalAmount: 1,
                            perNetWeight: 1,
                            netWeight: 4,
                            perGrossWeight: 1,
                            grossWeight: 5,
                            oldPartCode: 'oldPartCode691',
                            oldPartName: 'oldPartName692',
                            pickingListCode: 'pickingListCode693'
                        }, {
                            id: 'id787',
                            palletCode: 'palletCode688',
                            partSaleOrderCode: 'partSaleOrderCode788',
                            partCode: 'partCode789',
                            partName: 'partName790',
                            quantity: 1,
                            price: 1,
                            pricingDate: '2019-09-11T07:50:22Z',
                            totalAmount: 1,
                            perNetWeight: 1,
                            netWeight: 3,
                            perGrossWeight: 1,
                            grossWeight: 4,
                            oldPartCode: 'oldPartCode791',
                            oldPartName: 'oldPartName792',
                            pickingListCode: 'pickingListCode793'
                        }
                    ]
                },
                {
                    rowVersion: 'rowVersion',
                    id: 'id794',
                    code: 'code795',
                    packingType: 1,
                    container: 'container',
                    length: 1,
                    width: 1,
                    height: 1,
                    volume: 1,
                    netWeight: 1,
                    grossWeight: 1,
                    containerNo: 'containerNo',
                    remark: 'remark',
                    pickingListCodes: 'pickingListCodes',
                    palletCodes: 'palletCodes1,palletCodes2',
                    paymentTypes: 'paymentTypes',
                    shipmentTypes: 'shipmentTypes',
                    paymentType: 'paymentType',
                    priceTerms: 'priceTerms',
                    details: [
                        {
                            id: 'id887',
                            palletCode: 'palletCode688',
                            partSaleOrderCode: 'partSaleOrderCode888',
                            partCode: 'partCode889',
                            partName: 'partName890',
                            quantity: 1,
                            price: 1,
                            pricingDate: '2019-09-11T07:50:22Z',
                            totalAmount: 1,
                            perNetWeight: 1,
                            netWeight: 1,
                            perGrossWeight: 1,
                            grossWeight: 1,
                            oldPartCode: 'oldPartCode891',
                            oldPartName: 'oldPartName892',
                            pickingListCode: 'pickingListCode893'
                        }
                    ]
                }
            ],
            pageIndex: null,
            pageSize: null,
            sort: null,
            totalElements: 50,
            totalPages: null
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.dealerId 总代Id
 * @param {} options.brandId 品牌Id
 * @param {} options.code 箱单号
 * @param {} options.status 价格条款  1-包装完成  2-发票生成  -1-作废
 * @param {} options.pageSize 每页数据量
 * @param {} options.pageIndex 指定页
 * @param {} options.sortField 排序字段
 * @param {} options.isDesc 倒序排列
 * @throws {Error}
 * @return {Promise}
 */
router.get('/', async(req, res, next) => {
    const options = {
        dealerId: req.query.dealerId,
        brandId: req.query.brandId,
        code: req.query.code,
        status: req.query.status,
        pageSize: req.query.pageSize,
        pageIndex: req.query.pageIndex,
        sortField: req.query.sortField,
        isDesc: req.query.isDesc
    };
    const data = {
        message: 'message',
        payload: {
            content: [
                {
                    id: 'packingListId167',
                    dealerCode: 'dealerCode80',
                    dealerName: 'dealerName81',
                    code: 'code82',
                    packingType: 1,
                    container: 'container',
                    status: 1,
                    length: 1,
                    width: 1,
                    height: 1,
                    volume: 1,
                    netWeight: 1,
                    grossWeight: 1,
                    remark: 'remark',
                    rowVersion: 'rowVersion',
                    brandCode: 'brandCode1',
                    brandName: 'brandName1',
                    pickingListCode: 'pickingListCode1',
                    partSaleOrderCode: 'partSaleOrderCode1',
                    palletCode: 'palletCode1',
                    packingListId: '1',
                    pickAndPallet: '打法给多少给多少给多少给多少给多少范德萨发达省份的公司',
                    options: [
                        'update',
                        'close',
                    ]
                },
                {
                    id: 'id83',
                    dealerCode: 'dealerCode84',
                    dealerName: 'dealerName85',
                    code: 'code86',
                    packingType: 1,
                    container: 'container',
                    status: 1,
                    length: 1,
                    width: 1,
                    height: 1,
                    volume: 1,
                    netWeight: 1,
                    grossWeight: 1,
                    remark: 'remark',
                    rowVersion: 'rowVersion',
                    brandCode: 'brandCode2',
                    brandName: 'brandName2',
                    pickingListCode: 'pickingListCode2',
                    partSaleOrderCode: 'partSaleOrderCode2',
                    palletCode: 'palletCode2',
                    packingListId: '2',
                    options: [
                        'update',
                        'close',
                    ]
                }
            ],
            pageIndex: null,
            pageSize: null,
            sort: null,
            totalElements: 50,
            totalPages: null
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 备件装箱单Id
 * @throws {Error}
 * @return {Promise}
 */
router.get('/:id', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message',
        payload: {
            id: 'id87',
            code: 'code88',
            packingType: 1,
            container: 'container',
            status: 1,
            length: 1,
            width: 1,
            height: 1,
            volume: 1,
            netWeight: 1,
            grossWeight: 1,
            remark: 'remark',
            rowVersion: 'rowVersion',
            options: [
                'update',
                'close',
            ],
            details: [
                {
                    partSaleOrderCode: 'partSaleOrderCode89',
                    partOrderTypeCode: 'partOrderTypeCode90',
                    partOrderTypeName: 'partOrderTypeName91',
                    currency: 1,
                    transportType: 1,
                    pickingListCode: 'pickingListCode92',
                    partCode: 'partCode93',
                    partName: 'partName94',
                    oldPartCode: 'oldPartCode95',
                    oldPartName: 'oldPartName96',
                    quantity: 1,
                    price: 1,
                    totalAmount: 1,
                    palletCode: 'palletCode001'
                },
                {
                    partSaleOrderCode: 'partSaleOrderCode89',
                    partOrderTypeCode: 'partOrderTypeCode90',
                    partOrderTypeName: 'partOrderTypeName91',
                    currency: 1,
                    transportType: 1,
                    pickingListCode: 'pickingListCode392',
                    partCode: 'partCode393',
                    partName: 'partName394',
                    oldPartCode: 'oldPartCode395',
                    oldPartName: 'oldPartName396',
                    quantity: 1,
                    price: 1,
                    totalAmount: 1,
                    palletCode: 'palletCode002'
                },
                {
                    partSaleOrderCode: 'partSaleOrderCode89',
                    partOrderTypeCode: 'partOrderTypeCode90',
                    partOrderTypeName: 'partOrderTypeName91',
                    currency: 1,
                    transportType: 1,
                    pickingListCode: 'pickingListCode292',
                    partCode: 'partCode293',
                    partName: 'partName294',
                    oldPartCode: 'oldPartCode295',
                    oldPartName: 'oldPartName296',
                    quantity: 1,
                    price: 1,
                    totalAmount: 1,
                    palletCode: 'palletCode003'
                },
                {
                    partSaleOrderCode: 'partSaleOrderCode89',
                    partOrderTypeCode: 'partOrderTypeCode90',
                    partOrderTypeName: 'partOrderTypeName91',
                    currency: 1,
                    transportType: 1,
                    pickingListCode: 'pickingListCode192',
                    partCode: 'partCode1393',
                    partName: 'partName1394',
                    oldPartCode: 'oldPartCode1395',
                    oldPartName: 'oldPartName1396',
                    quantity: 1,
                    price: 1,
                    totalAmount: 1,
                    palletCode: 'palletCode004'
                },
                {
                    partSaleOrderCode: 'partSaleOrderCode97',
                    partOrderTypeCode: 'partOrderTypeCode98',
                    partOrderTypeName: 'partOrderTypeName99',
                    currency: 1,
                    transportType: 1,
                    pickingListCode: 'pickingListCode100',
                    partCode: 'partCode1201',
                    partName: 'partName1202',
                    oldPartCode: 'oldPartCode1203',
                    oldPartName: 'oldPartName1204',
                    quantity: 1,
                    price: 1,
                    totalAmount: 1,
                    palletCode: 'palletCode005'
                },
                {
                    partSaleOrderCode: 'partSaleOrderCode97',
                    partOrderTypeCode: 'partOrderTypeCode98',
                    partOrderTypeName: 'partOrderTypeName99',
                    currency: 1,
                    transportType: 1,
                    pickingListCode: 'pickingListCode200',
                    partCode: 'partCode2101',
                    partName: 'partName2102',
                    oldPartCode: 'oldPartCode2103',
                    oldPartName: 'oldPartName2104',
                    quantity: 1,
                    price: 1,
                    totalAmount: 1,
                    palletCode: 'palletCode006'
                }
            ]
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 备件装箱单Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/apply', async(req, res, next) => {
    const data = {
        message: 'message'
    };
    res.json(data);
});
router.put('/reject', async(req, res, next) => {
    const data = {
        message: 'message'
    };
    res.json(data);
});
router.put('/:id', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 备件装箱单Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id/close', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @throws {Error}
 * @return {Promise}
 */
router.post('/import', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});

router.post('/pack', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
module.exports = router;
